#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : gtmsAutoTestProject 
@File    : member_deleted_interface.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/5/11 17:36 
@Describe: 会员数据删除接口
"""
from fastapi import APIRouter
from FastApi.dto.baseResponseDto import BaseResponseDtoModel
from FastApi.server.miniProgram.member.member_deleted_server import member_deleted
from FastApi.dto.miniProgram.memberDto.member_deleted_dto import MemberDeleteDtoModel
from Comm.logUtils.logControl import LogHandler

logger = LogHandler().get_logger()
memberDeleted_router = APIRouter()
response_model = BaseResponseDtoModel()


@memberDeleted_router.post("/deleted", name="删除手机号绑定会员")
async def memberDeleted(payload: MemberDeleteDtoModel):
    logger.info('请求参数:[{}]'.format(payload))
    response_data = member_deleted(payload.phone, payload.brandCode)
    response_model.return_dict['data'] = response_data
    response_model.return_dict['message'] = "会员数据清除成功！"
    logger.info('接口响应:[{}]'.format(response_model.return_dict))
    return response_model.return_dict
